package com.foton.smsserver;

import com.foton.bpc.all.config.annotion.EnableBpc;
import com.foton.smsserver.provider.SmsServiceImpl;
import com.foton.smsserver.util.ClassLoaderUtil;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.annotation.PropertySource;
import org.springframework.context.annotation.PropertySources;
import org.springframework.util.ClassUtils;

import java.io.IOException;
@PropertySources(@PropertySource(value = "classpath:trpc.properties", ignoreResourceNotFound = true, encoding = "UTF-8"))
@SpringBootApplication
@EnableBpc
public class SmsServerApplication {

    public static void main(String[] args) throws IOException, ClassNotFoundException {
//        SpringApplication.run(SmsServerApplication.class, args);

        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(SmsServerApplication.class);
        context.start();

//        //@BpcService，注解是否继承spring成功，如果成功得话则可以获取容器对应得bean对象
//        SmsServiceImpl smsService = context.getBean(SmsServiceImpl.class);
//        smsService.send("10086","发送了一条测试短信，请查收！！！！！");

        Class<?> classByPackageName = ClassLoaderUtil.getClassByPackageName(SmsServerApplication.class.getPackage().toString());



        System.in.read();
        context.close();
    }

}
